package com.fs.m.server.function.test;

import com.fs.m.server.domain.Result;
import com.fs.m.server.function.Function;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: zhuguoyin
 * Date: 13-10-7
 * Time: 下午4:45
 * To change this template use File | Settings | File Templates.
 */
public class IndexFunction1 implements Function {
    @Override
    public Result execute() throws Exception {
        Result result = new Result();
        List all = new ArrayList();
        List row1 = new ArrayList();
        Map category1 = new HashMap();
        category1.put("name", "阿狸系列");
        category1.put("url", "http://www.baidu.com");
        category1.put("id", 12345);
        category1.put("width", 120);
        category1.put("height", 60);
        row1.add(category1);

        Map category2 = new HashMap();
        category2.put("name", "悠嘻猴");
        category2.put("url", "http://www.baidu.com");
        category2.put("id", 12345);
        category2.put("width", 120);
        category2.put("height", 60);
        row1.add(category2);

        Map category3 = new HashMap();
        category3.put("name", "点当");
        category3.put("url", "http://www.baidu.com");
        category3.put("id", 12345);
        category3.put("width", 120);
        category3.put("height", 60);
        row1.add(category3);
        all.add(row1);

        List row2 = new ArrayList();
        Map category4 = new HashMap();
        category4.put("name", "流氓兔");
        category4.put("url", "http://www.baidu.com");
        category4.put("id", 12345);
        category4.put("width", 120);
        category4.put("height", 60);
        row2.add(category4);

        Map category5 = new HashMap();
        category5.put("name", "摩丝摩丝");
        category5.put("url", "http://www.baidu.com");
        category5.put("id", 12345);
        category5.put("width", 120);
        category5.put("height", 60);
        row2.add(category5);
        all.add(row2);

        List row3 = new ArrayList();
        Map category6 = new HashMap();
        category6.put("name", "林大B");
        category6.put("url", "http://www.baidu.com");
        category6.put("id", 12345);
        category6.put("width", 120);
        category6.put("height", 60);
        row3.add(category6);

        Map category7 = new HashMap();
        category7.put("name", "三国杀");
        category7.put("url", "http://www.baidu.com");
        category7.put("id", 12345);
        category7.put("width", 120);
        category7.put("height", 60);
        row3.add(category5);
        all.add(row3);

        result.addResultData("categories", all);
        return result;
    }
}
